import request from '@/utils/request'


// 获取院区列表
export function listCampus(params) {
    return request({
        url: '/system/hospitalCampus/list',
        method: 'get',
        params: {
            pageNum: params.pageNum,
            pageSize: params.pageSize,
            campusName: params.campusName
        }
    })
}

// 获取院区详情（包含联系电话）
export function getCampus(id) {
    return request({
        url: `/system/hospitalCampus/${id}`,
        method: 'get'
    })
}

// 新增院区
export function saveCampus(data) {
    return request({
        url: '/system/hospitalCampus/save',
        method: 'post',
        data
    })
}

// 修改院区
export function updateCampus(data) {
    return request({
        url: '/system/hospitalCampus/update',
        method: 'put',
        data
    })
}

// 删除院区
export function deleteCampus(id) {
    return request({
        url: `/system/hospitalCampus/delete/${id}`,
        method: 'delete'
    })
}

//根据院区名称获取院区id
export function getCampusIdByName(name) {
    return request({
        url: `/system/hospitalCampus/getIdByName/${name}`,
        method: 'get'
    })
}
